﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WCS_Quartz_Task._631
{
    /// <summary>
    /// AGV等待中处理,符合继续执行任务后触发AGV继续执行任务
    /// </summary>
    public class AgvWaitJob : IJob
    {
        public async Task Execute(IJobExecutionContext context)
        {
            CancellationToken ct = CancellationToken.None;

            await Task.Run(async () =>
            {
                JobDataMap data = context.JobDetail.JobDataMap;
                var agvWaitCheck = data["agvWait"] as Func<Task>;
                await agvWaitCheck();
            }, ct);
        }
    }
}
